from bs4 import BeautifulSoup

if __name__ == '__main__':
  pass

html = open('./file/b.html', 'r', encoding='utf8')

soup = BeautifulSoup(html, 'html.parser')

# print(html.readlines())
# print(soup.find_all('img'))

bt = open('./file/b.img.txt', 'w', encoding='utf8')

for img in soup.find_all('p'):
  bt.writelines([img._all_strings, '\n'])
  # print(img)

bt.close()